/*eslint-disable*/
import { ThirdSection } from './index';
// import ThemeContext from './ThemeContext';
import React, { useContext } from 'react';
import { connect } from 'react-redux'

class ChildThird extends React.Component {
	// static contextType = ThemeContext

	// componentDidMount () {
	// 	const { store } = this.context
	// 	this.unsubscribe = store.subscribe(() => {
	// 		this.forceUpdate() 
	// 	})
	// }
	render () {
		// const { store } = this.context
		// const { supNum, oppNum, supPercent } = store.getState()
		// const { othersStore } = this.context
		// const { supTian, oppTian, supTianPercent } = othersStore.getState()
		const { supNum, oppNum, supPercent, supTian, oppTian, supTianPercent } = this.props
		return <ThirdSection>
			<div>类组件</div>
			<div>支持人数：{supNum}</div>
			<div>反对人数：{oppNum}</div>
			<div>支持比例：{isNaN(supPercent) ? 0 : supPercent}%</div>
			<div>喜欢甜甜人数：{supTian}</div>
			<div>不喜欢甜甜人数：{oppTian}</div>
			<div>喜欢比例：{isNaN(supTianPercent) ? 0 : supTianPercent}%</div>
		</ThirdSection>;
	}
}

export default connect(state => ({ ...state }))(ChildThird)